#include <iostream>
#include <vector>

using namespace std;

const int N = 2e5 + 5;

std::vector<int> primes;
bool st[N];

void get_primes(int n) {
	for (int i = 2; i <= n; ++i) {
		if (!st[i]) {
			primes.push_back(i);
		}
		for (int j : primes) {
			if (i * j > n) {
				break;
			} 
			st[i * j] = true;
			if (i % j == 0) {
				break;
			}
		}
	}
}

int main() {
	int n = 100;
	get_primes(n);
	
	for (int i = 0; i < primes.size(); ++i) {
		cout << primes[i] << " ";
	}
	return 0;
}
